#include "Menu_State.h"
#include "System.h"
#include "Ulti.h"
#include <stdio.h>

//-------Methoods for Intro State--------
Intro* Intro::Instance()
{
	static Intro instance;
	return &instance;
}

void Intro::Enter(System* system)
{
	log2file("Enter Intro state\n");
}

void Intro::Execute(System* system)
{
	system->DoIntro();
	system->ChangeState(MainMenu::Instance());
}

void Intro::Exit(System* system)
{
	log2file("Exit Intro state\n");
}

//-------Methoods for MainMenu State--------
MainMenu* MainMenu::Instance()
{
	static MainMenu instance;
	return &instance;
}

void MainMenu::Enter(System* system)
{
	printf("Enter MainMenu state\n");
}

void MainMenu::Execute(System* system)
{
	system->DoMainMenu();
	if(system->choose==1)
	{
		system->ChangeState(NewGame::Instance());
	}else if(system->choose==2)
	{
		system->ChangeState(ExitGame::Instance());
	}
	system->choose=0;
}

void MainMenu::Exit(System* system)
{
	printf("Exit mainMenu state\n");
}

//-------Methoods for NewGame State--------
NewGame* NewGame::Instance()
{
	static NewGame instance;
	return &instance;
}

void NewGame::Enter(System* system)
{
	printf("Enter NewGame state\n");
}

void NewGame::Execute(System* system)
{
	system->DoNewGame();
	system->ChangeState(MainMenu::Instance());
}

void NewGame::Exit(System* system)
{
	printf("Exit NewGame state\n");
}

//-------Methoods for ExitGame State--------
ExitGame* ExitGame::Instance()
{
	static ExitGame instance;
	return &instance;
}

void ExitGame::Enter(System* system)
{
	printf("Enter ExitGame state\n");
}

void ExitGame::Execute(System* system)
{
	system->DoExitGame();
}

void ExitGame::Exit(System* system)
{
	printf("Exit ExitGame state\n");
}